import { queryLogReq, queryRestartReq, queryStopReq, querySummaryReq, runningRetryReq } from './api'

export default {
  namespace: 'operationRealTime',
  state: {},
  effects: {
    * querySummary({ params, cb }, { call, put }) {
      const res = yield call(querySummaryReq, params)
      if (cb) {
        cb(res)
      }
    },
    * queryLog({ params, cb }, { call, put }) {
      const res = yield call(queryLogReq, params)
      if (cb) {
        cb(res)
      }
    },
    * queryRestart({ params, cb }, { call, put }) {
      const res = yield call(queryRestartReq, params)
      if (cb) {
        cb(res)
      }
    },
    * queryStop({ params, cb }, { call, put }) {
      const res = yield call(queryStopReq, params)
      if (cb) {
        cb(res)
      }
    },
    * runningRetry({ params, cb }, { call, put }) {
      const res = yield call(runningRetryReq, params)
      if (cb) {
        cb(res)
      }
    },
  },
  reducers: {},
}
